<template>
  <el-select style="width: 100%" v-model="value" clearable filterable placeholder="状态"
             @change="selectStatus" value-key="status">
    <el-option
      v-for="item in statusData"
      :key="item.status"
      :label="item.value"
      :value="item">
    </el-option>
  </el-select>
</template>

<script>
import utils from '../../utils/utils.js'
export default{
  props:["value"],
  data(){
    return{
      query:{
        status:'',
        value:"",
      },
      statusData: [{
        status: 0,
        value:'未认证' ,
      }, {
        status: 1,
        value: '已认证',
      }, {
        status: 2,
        value: '已驳回',
      }],
      value:''
    }
  },
  watch:{
    value(newval,oldval){
      this.value=newval
    }

  },
  created() {
    this.query.value=this.value

  },
  methods:{
    selectStatus(data) {
      console.log(data,"status")
      if(!utils.isNull(data)){
        this.query.status = data.status
        this.query.value = data.value
      }else{
        this.query.value = ''
        this.query.status = ''
      }
      this.$emit('queryStatus',this.query)
    },
  }
}
</script>

<style>

</style>

